<template>
  <div>
    <div class="step_box">
      <div
        v-bind:class="[index+1 < stepnow ? 'step_down':'',index+1 == stepnow ? 'step_now':'']"
        v-for="(item,index) in this.stepmsg"
        :key="index">
        <span>{{index+1}}</span>
        <p>{{item}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["stepnow","stepmsg"],
  name: "stepLine",

}
</script>

<style scoped>
  p{
    margin: 0;
  }
.step_box{
  height: 50px;
  width: calc(100% - 25px);
  display: flex;
  flex-direction: row;
}

.step_box>div{
  flex: 1;
  background: #d1f2ff;
  margin-left: 25px;
  position: relative;
  padding-left: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.step_box>div::before{
  content: '';
  width: 0;
  height: 0;
  border-width: 25px;
  border-style: solid;
  border-color: transparent transparent transparent #d1f2ff;
  position: absolute;
  right: -50px;
}
.step_box>div::after{
  content: '';
  width: 0;
  height: 0;
  border-width: 25px;
  border-style: solid;
  border-color: transparent transparent transparent #fff;
  position: absolute;
  left: 0px;
}

.step_box>div:first-child{
  padding-left: 20px;
  margin-left: 0;
}
.step_box>div:first-child::after{
  display: none;
}
.step_box>div.step_down{
  background: #dcdcdc;
}
.step_box>div.step_down::before{
  border-color: transparent transparent transparent #dcdcdc;
}
.step_box>div.step_now{
  background: #4ca3ed;
}
.step_box>div.step_now::before{
  border-color: transparent transparent transparent #4ca3ed;
}
.step_box>div span{
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: #fff;
  line-height: 30px;
  text-align: center;
  color: #4ca3ed;
  font-size: 24px;
  font-weight: bold;
  margin-right: 12px;
}
.step_box>div p{
  font-size: 20px;
  color: #4ca3ed;
}
.step_box>div.step_down p{
  color: #666666;
}
.step_box>div.step_down span{
  color: #666;
}
.step_box>div.step_now p{
  color: #fff;
}
</style>
